package com.fyt.ZhongYaoApp.mapper;

import com.fyt.ZhongYaoApp.pojo.ZYCat;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ZYCatMapper {

    @Insert("insert into zy_Cat(cat_name)" +
            "values (#{catName})")
    void add(ZYCat zyCat);

    @Select("select cat_name from zy_cat where id = #{id}")
    String getNameById(ZYCat zyCat);

    @Select("select * from zy_cat where 1=1")
    List<ZYCat> zyCatList();

    @Select("select * from zy_cat where cat_name = #{catName}")
    ZYCat findByZYCatName(String zycatName);
}
